package com.zkw.group.service;

import com.zkw.group.entity.CoursePage;
import com.zkw.group.mapper.CoursePageMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CoursePageService {

    @Autowired
    private CoursePageMapper coursePageMapper;

    //分页获取课程章节列表
    public List<CoursePage> getAllCoursePageList(String ord,String courseid,int pageStart,int pageSize){
        return coursePageMapper.getAllCoursePageList(ord,courseid,pageStart,pageSize);
    }

    //获取课程章节条目数
    public int getCoursePageCounts(String ord,String courseid){
        return  coursePageMapper.getCoursePageCounts(ord,courseid);
    }

    //添加课程章节
    public int addCoursePage(CoursePage coursePage){
        return coursePageMapper.addCoursePage(coursePage);
    }

    //删除课程章节
    public int deleteCoursePage(String ord,String courseid){
        return coursePageMapper.deleteCoursePage(ord,courseid);
    }

    //获取要更新的课程章节信息以及更新课程章节信息
    public CoursePage getUpdateCoursePage(String ord,String courseid){
        return coursePageMapper.getUpdateCoursePage(ord,courseid);
    }

    public int updateCoursePage(CoursePage coursePage){
        return coursePageMapper.updateCoursePage(coursePage);
    }
}
